﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Title -->
    <title>XK-Blog</title>

    <!-- /favicon -->
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="/assets1/css/bootstrap.min.css">

    <!--矢量图标-->
    <link rel="stylesheet" href="/style/icon/icon.css">

    <!-- Font awesome CSS -->
    <link rel="stylesheet" href="/assets1/css/font-awesome.min.css">

    <!-- Animate CSS -->
    <link rel="stylesheet" href="/assets1/css/animate.min.css">

    <!-- OwlCarousel CSS -->
    <link rel="stylesheet" href="/assets1/css/owl.carousel.css">

    <!-- SlickNav CSS -->
    <link rel="stylesheet" href="/assets1/css/slicknav.min.css">

    <!-- Magnific popup CSS -->
    <link rel="stylesheet" href="/assets1/css/magnific-popup.css">

    <!-- Main CSS -->
    <link rel="stylesheet" href="/assets1/css/style.css">

    <!-- Responsive CSS -->
    <link rel="stylesheet" href="/assets1/css/responsive.css">

</head>
<body>


<!-- Footer Area Start -->
<footer class="rapid-footer-area" th:fragment="blogDown">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="footer-left">
                    <p>Copyright © Rapid. All rights reserved.</p>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- Footer Area End -->


<!-- jQuery -->
<script src="/assets1/js/jquery.min.js"></script>

<!-- Bootstrap JS -->
<script src="/assets1/js/bootstrap.min.js"></script>

<!-- Magnific Popup JS -->
<script src="/assets1/js/jquery.magnific-popup.min.js"></script>

<!-- OwlCarousel JS -->
<script src="/assets1/js/owl.carousel.min.js"></script>

<!-- SlickNav JS -->
<script src="/assets1/js/jquery.slicknav.min.js"></script>

<!-- Custom JS -->
<script src="/assets1/js/custom.js"></script>

<script>
    $(function () {
        $("[data-toggle='popover']").popover();
    });


    <!--已有窗口跳转（避免创建多个重复窗口）(抖音，小红书跳转)-->
    const windows = {};  // 用于存储打开的窗口

    $('.external-link').on('click', function(e) {
        e.preventDefault();

        const url = $(this).attr('href');  // 获取链接目标 url
        const name = url.replace(/\W/g, '');  // 移除非字母数字字符用作窗口名称

        // 如果窗口未打开，或者窗口已经被关闭，则重新打开窗口
        if (typeof windows[name] == 'undefined' || windows[name].closed) {
            windows[name] = window.open(url, name);
        } else {
            windows[name].focus();  // 否则，让已打开的窗口获取焦点
        }
    });

    <!--切换分页时保存滚轮位置-->
    function keepScrollPos(url) {
        //存储滚动位置
        const scrollPos = $(window).scrollTop();
        localStorage.setItem('scrollPos', scrollPos);

        // 重定向到点击的页面
        window.location.href = url;
        return false;
    }

    <!--加载页面时，获取滚轮位置-->
    $(document).ready(function() {
        //检索滚动位置
        const scrollPos = localStorage.getItem('scrollPos');
        if (scrollPos) {
            $(window).scrollTop(scrollPos);
            localStorage.removeItem('scrollPos');
        }
    });



</script>
</body>

</html>
